/* -*- C++ -*- */
/*===========================================================
 
 .---=||||[ B L O O D Y ]|||||=====================----------....
 |                                                              |
 |    THE  M O S T   B L O O D Y  GAME EVER!                    |
 |                                                              |
 |    bloody harvest is coming... soon,                         |
 |                                              heil Satan!     |
 !                                                              !
 .                                                              ,
  ~~~~-------------================================|||||||||==-~




 Name-Space: {core, logic, editor}
 Module: {draw, coll, scgr, ...}
 Class: <name of class>
 Last modification:  <author>, <time>

 TODO:
 <-------- todo #1 ---------->
 <-------- todo #2 ---------->
 <-------- todo #3 ---------->
        ............
 <-------- todo #n ---------->

 FIX:
 <-------- fix #1 ----------->
 <-------- fix #1 ----------->
         ..........
 <-------- fix #n ----------->




 
 
 ============================================================*/




#ifndef __draw_Texture_Manager_Header_File__
#define __draw_Texture_Manager_Header_File__

#include "common.h"
#include "core/draw/Texture.h"

namespace core
{
   namespace draw
   {

      class Texture;
      class TextureManager
      {
	    typedef std::map<std::string, Texture*> TextureList;
	    typedef std::map<unsigned int, Texture*> IdList;
	    TextureList textureList;
	    IdList idList;
			
	    unsigned int loadTexture(std::string fileName);
		
	    TextureManager();
	    virtual ~TextureManager();
		
		
		
	    static TextureManager* inst;
		
		
	 public:
	    static TextureManager& instance()
	    {
	       if (!inst)
	       {
		  inst = new TextureManager();
	       }
		
	       return *inst;
	    }

	    static void free()
	    {
	       if (inst) delete inst;
	    }

	    Texture* add(std::string fileName);
	    Texture* get(std::string fileName);//{ return textureList[fileName]; }
	    Texture* get(unsigned int id);//{ return idList[id]; }
      };
		
   }
}

#endif //__draw_Texture_Manager_Header_File__
